<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <title>数据导出</title>
    <th:block th:include="~{common/common::commonHead}"/>
</head>
<body data-width="500" data-height="300">
<div class="container-fluid">
    <form class="form-horizontal" role="form" th:action="@{/data/export}">
        <div class="form-group">
            <label class="col-xs-4 control-label text-right">导出目标：</label>
            <div class="col-xs-8">
                <div class="iconic-input right">
                    <select class="form-control spinner" id="target" name="target" required title="请选择一项">
                        <option value="" >请选择数据目标</option>
                        <option value="1" th:unless="${@projectConfig.environment == 'outer'}">外网</option>
                        <option value="2" th:unless="${@projectConfig.environment == 'inner'}">内网</option>
                        <option value="3" th:unless="${@projectConfig.environment == 'bank'}">银行</option>
                    </select>
                </div>
            </div>
        </div>
        <div class="form-group hide" id="prison">
            <label class="col-xs-4 control-label text-right">监所/看守所：</label>
            <div class="col-xs-8">
                <div class="iconic-input right">
                    <select id="prisonId" class="form-control spinner" name="prisonId"
                            data-url="org/listPrison" data-value-field="id" data-text-field="orgName"
                            required title="请选择监所">
                        <option value="">请选择监所/看守所</option>
                    </select>
                </div>
            </div>
        </div>
    </form>
</div>
</body>
</html>
<script>
    $(function () {
        $("#target").on("change", function () {
            var value = $(this).val();
            if (value === "2") {
                $("#prison").removeClass("hide");
            } else {
                $("#prison").addClass("hide");
            }
        });
    });
</script>